/*
 * @Description: 
 * @Author: zoe
 * @Date: 2024-09-20 11:24:40
 * @LastEditors: rendc
 * @LastEditTime: 2024-09-20 15:23:02
 */
public class Test03Animal2 {
    public static void main(String[] args) {
        //抽象类不能实例化对象，但是可以定义引用指向子类对象
        Animal2 animalMonkey = new Monkey("棕色",2,"悟空");
        animalMonkey.eat();
        animalMonkey.sleep();

        
        //编译看左边，运行看右边
        IJumpAble ij = new Monkey("棕色",2,"悟空");
        ij.jumpFireCircle();
        ICycleAble ic = new Monkey("棕色",2,"悟空");
        ic.rideBike();
        //强制转换
        Monkey m = (Monkey) ic;
        m.eat();
        m.sleep();
    }
}
